

export default{
    state : {
        status: "matching", // matching表示匹配，playing表示对战界面

        socket:null,
        opponent_username:"",
        opponent_photo:"",
        game_map:null,
        a_id: 0,
        a_sx: 0,
        a_xy: 0,
        b_id: 0,
        b_sx: 0,
        b_sy: 0,
        gameObject: null,
        Loser:"none", //all,you,he
        botId:-1, //-1代表人来操作.

    },
    getters: {
    },
    mutations: {
    updateSocket(state,socket){
        state.socket = socket;
      },
    updateOpponent(state,opponent){
        state.opponent_username = opponent.username;
        state.opponent_photo = opponent.photo;
    },
    updateStatus(state,status){
        state.status = status;
    },
    updateGame(state,game){
        state.game_map = game.map
        state.a_id = game.a_id;
        state.a_sx = game.a_sx;
        state.a_sy = game.a_sy;
        state.b_id = game.b_id;
        state.b_sx = game.b_sx;
        state.b_sy = game.b_sy;

    },
    updategameObject(state,gameObject){
        state.gameObject = gameObject;
    },
    updateLoser(state,Loser){
        state.Loser = Loser;
    },
    updateBotId(state,botId){
        state.botId = botId;
    }

    },
    actions: {
    },
    modules: {
    }
}